package smartcarpool.smartspaceservice;

import android.os.Parcel;
import android.os.Parcelable;

public class SmartSpaceProfile implements Parcelable{
	
	private String HOST;
	private String SPACE_NAME;
	private int PORT;
	
	public SmartSpaceProfile(String host, int port, String space_name) {
		this.HOST = host;
		this.PORT = port;
		this.SPACE_NAME = space_name;
	}

	public String getHost(){
		return HOST;
	}
	
	public int getPort() {
		return PORT;
	}
	
	public String getSpaceName() {
		return SPACE_NAME;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	public static final Parcelable.Creator<SmartSpaceProfile> CREATOR
    = new Parcelable.Creator<SmartSpaceProfile>() {
		public SmartSpaceProfile createFromParcel(Parcel in) {
			return new SmartSpaceProfile(in);
		}

		public SmartSpaceProfile[] newArray(int size) {
			return new SmartSpaceProfile[size];
		}
	};

	@Override
	public void writeToParcel(Parcel parcel, int arg1) {
		parcel.writeString(HOST);
		parcel.writeInt(PORT);
		parcel.writeString(SPACE_NAME);
	}
	
	private SmartSpaceProfile(Parcel parcel){
		this.HOST = parcel.readString();
		this.PORT = parcel.readInt();
		this.SPACE_NAME = parcel.readString();
	}
}
